dynasty would be replaced by that of Huan Wen's, but he assured him that Huan Wen was only doing what was best for the state. As Chi Chao withdrew himself to see his father, the emperor sighed and told him to tell his father that his emperor had failed to protect the state. Meanwhile, the Jin ministers, Xie An and Wang Tanzhi, formed an alliance to prevent too much power from falling into Huan Wen's hands. They often visited Huan Wen and Chi Chao's home to discuss important matters. One time, as Chi Chao and Huan Wen made a list on who to purge from the court, Xie An and Wang Tanzhi came visiting. Huan Wen hid Chi Chao behind his bed curtains but when a gust of wind revealed him, Xie An simply joked, "You can say that he is your 'guest within the curtains (入幕之賓)'!" After Huan Wen's death Emperor Jianwen died just a year into his reign and was replaced by his on Emperor Xiaowu. However, Huan Wen would also die in 373, and Chi Chao found his power greatly diminished because of this. Chi took the role Chief Clerk of the Left of the Minister Over The Masses after Huan's death, but had to leave the government to hold a mourning session for his mother. This allowed Xie An to influence the court during Chi's absence. When he returned from his session, court decided to appoint Chi Chao Cavalier In Regular Attendance, General Who Declares Might and Prefect of Linhai, but he turned them all down. Despite Huan Wen's family holding two-thirds of the empire, his brother and successor, Huan Chong had no imperial ambitions and stayed loyal to the Jin dynasty. In 375, Chi Chao tried to stop Huan Chong from giving up his power in Yangzhou to Xie An, but Chong persisted. Chi Chao grew to resent the Xie family, particularly, Xie An and Xie Xuan, for their growing prominence in the state while his father slowly went down the ranks. In 377, the Former Qin state threatened the dynasty and there was no one leading the defense against them, so Xie An nominated his nephew Xie Xuan. When Chi Chao heard this, he unexpectedly accepted this outcome and praised the two Xies. The court was in disbelief as Xie Xuan at this point had never held such an important position. However, Chi Chao