 He escaped from Chang 'an the following year , and was appointed <unk> when he rejoined the court in May <unk> . This post gave access to the emperor but was largely ceremonial . Du Fu 's <unk> compelled him to try to make use of it : he caused trouble for himself by protesting the removal of his friend and patron Fang Guan on a petty charge . He was arrested but was <unk> in June . He was granted leave to visit his family in September , but he soon rejoined the court and on December 8 , <unk> , he returned to Chang 'an with the emperor following its recapture by government forces . However , his advice continued to be <unk> , and in the summer of <unk> he was demoted to a post as Commissioner of Education in <unk> . The position was not to his taste : in one poem , he wrote : 
