In 207 BC, the combined forces of Liu Bang and Han Cheng conquered Yangzhai (present-day Yuzhou City, Henan), the former capital of the Hán state. Han Cheng stayed behind to defend Yangzhai, while Zhang Liang served as a temporary advisor to Liu Bang. Zhang Liang contributed to Liu Bang's eventual victory in the race to Guanzhong for the strategies he proposed. For example, at the battle of Yao Pass, Zhang Liang suggested tricking the Qin commander into surrendering by bribing him with gifts. Liu Bang wanted to accept the surrendered Qin troops into his army but Zhang Liang cautioned him, saying that some of the troops were unwilling to surrender even though their commander agreed. That night, Liu Bang's forces caught the Qin army off guard and scored a major victory. In another incident, Zhang Liang warned Liu Bang against making a detour at Wancheng, because they would be at risk of being surrounded by the enemy if Liu did so.