Shimin's staff. Zhangsun, who remained on Li Shimin's staff, continued to try to persuade Li Shimin to attack first. In summer 626, the Eastern Turkic khaganate was making another attack, and under Li Jiancheng's suggestion, Emperor Gaozu, instead of sending Li Shimin to resist the Turks as he first was inclined, decided to send Li Yuanji instead. Li Yuanji was given command of much of the army previously under Li Shimin's control, further troubling Li Shimin, who believed that with the army in Li Yuanji's hands, he would be unable to resist an attack. Li Shimin had Yuchi summon Fang and Du back to his mansion secretly, and then on one night submitted an accusation to Emperor Gaozu that Li Jiancheng and Li Yuanji were committing adultery with Emperor Gaozu's concubines. Emperor Gaozu, in response, issued summonses to Li Jiancheng and Li Yuanji for the next morning, convening the senior officials Pei Ji, Xiao Yu, and Chen Shuda to examine Li Shimin's accusations. As Li Jiancheng and Li Yuanji approached the central gate leading to Emperor Gaozu's palace, Xuanwu Gate (), Li Shimin carried out the ambush he had set. He personally fired an arrow that killed Li Jiancheng. Subsequently, Yuchi killed Li Yuanji. Li Shimin's forces entered the palace and, under the intimidation of Li Shimin's forces, Emperor Gaozu agreed to create Li Shimin crown prince. Meanwhile, Li Shimin accused the late Li Jiancheng and Li Yuanji of plotting treason, posthumously demoted them to commoners and had their sons all executed as well, with Emperor Gaozu unable to oppose the action. Two months later, Emperor Gaozu passed the throne to Li Shimin (as Emperor Taizong). As retired emperor Emperor Gaozu, as retired emperor, did not appear to try to exert much influence in the reign of his son Emperor Taizong, and not much was recorded about his activities. Indeed, Emperor Taizong, almost immediately, began reversing some of his policies, including his policies of creating many relatives to be imperial princes (which Emperor Taizong reversed later in 626, reducing the ranks of most of those princes to dukes) and Emperor Gaozu's gathering of many ladies in waiting (which Emperor Taizong reversed in 628, releasing about 3,000 ladies in waiting from service, although Emperor Taizong himself, later in his reign, appeared to have gathered as many if not more). In 629, Emperor Gaozu moved from the main palace, Taiji Palace ()