Meanwhile, the wars with Liang continued, and while both sides had gains and losses, Northern Wei made a substantial gain in 505 when the Liang general Xiaohou Daoqian (夏侯道遷) surrendered Nanzheng (南鄭, in modern Hanzhong, Shaanxi), as well as the surrounding region, to Northern Wei, which further annexed the semi-independent state Chouchi in spring 506. In winter 505, Liang launched a major counterattack on the eastern part of the border, commanded by Emperor Wu's brother Xiao Hong (蕭宏) the Prince of Linchuan, but with Xiao Hong being an incompetent general, who mishandled a night terror situation in summer 506, while his army was at Luokou (洛口, in modern Bengbu, Anhui), the Liang forces collapsed by themselves without engaging Northern Wei forces. Yuan Ying and Xiao Baoyin followed up by attacking the Liang fortress Zhongli (鍾離, in modern Chuzhou, Anhui), but were dealt a crushing defeat by the Liang general Wei Rui (韋叡) in spring 507. The two states largely stopped their military activities against each other after that point.