Xue Ju saw the fallacy in asking the question, and he greatly rewarded Hao and made Hao his chief strategist. Subsequently, when Li Yuan sent his generals Jiang Mo (), Dou Gui (), and Liu Shirang () against Xue Ju, Xue Ju defeated them and captured Liu, and Jiang and Dou withdrew. Subsequently, under Hao's suggestion, Xue sought to enter a three-way alliance with Eastern Tujue's forces and those of another rebel leader, Liang Shidu the Emperor of Liang, to try to capture Chang'an. However, Li Yuan's general Zhang Changsun () then warned the Tujue general Ashina Duobi that he was aware of their three-way pact, and Ashina Duobi chose to renege and not assist either Xue Ju or Liang. (Soon, after hearing that Emperor Yang had been killed in a coup led by Yuwen Huaji in Jiangdu (江都, in modern Yangzhou, Jiangsu), Li Yuan had Yang You yield the throne to him, establishing Tang Dynasty as its Emperor Gaozu.)