Emperor Yang, believing that he was well-protected by the elite Xiaoguo Army and not wanting to return to the turbulent north, considered moving the capital to Danyang (丹陽, in modern Nanjing, Jiangsu). Meanwhile, Xiaoguo soldiers were largely from Guanzhong (i.e., the region around the capital Chang'an), and they missed their home. Once they saw that Emperor Yang was not intending to return, they considered fleeing. Several Xiaoguo officers—the chief among whom were Sima Dekan (司馬德戡), Pei Qiantong (裴虔通), and Yuan Li (元禮)—planned an organized plot to flee. When two of the officers involved in the plot, Yuwen Zhiji's friend Zhao Xinshu (趙行樞) and Yuwen Zhiji's nephew Yang Shilan (楊士覽), discussed the plan with Yuwen Zhiji, Yuwen Zhiji opined that if the Xiaoguo soldiers fled, they would surely be chased down and executed; rather, he suggested that they carry out a coup instead. At the suggestion of Zhao and Xue Shiliang (薛世良), they decided to invite Yuwen Huaji to be their leader. Yuwen Huaji, who was described as cowardly, initially panicked when offered the leadership, but eventually accepted.