Why did you come here?" This caused many of Wu's colleagues to be shocked and lose composure, but Wu did not. Nevertheless, Yuan's poetry continued to become increasingly popular at Chang'an, such that the people were rushing to learn it. Soon thereafter, Yuan was made chief imperial scholar (翰林承旨學士, "Hanlin Xueshi") as well as "Zhongshu Sheren" (), a mid-level official at the legislative bureau. Because of the friendship that Yuan had with Cui, the other eunuchs were also trying to become friendly with Yuan, particularly the one of the directors of palace communications ("Shumishi"), Wei Hongjian (). In 821, Yuan was involved in an incident that was considered one of the precipitating incidents of the coming Niu-Li Factional Struggles. At that time, both Yuan and imperial scholar Li Deyu were involved in power struggles with Yuan's fellow "Zhongshu Sheren" Li Zongmin. Meanwhile, Li Zongmin's junior colleague at the legislative bureau, Yang Rushi () and the deputy minister of rites (禮部侍郎, "Libu Shilang") Qian Hui () were in charge of overseeing the imperial examinations. The military governor Duan Wenchang (a former chancellor) and the imperial scholar Li Shen both made secret pleas to Qian for certain examinees. However, when the results were announced, the examinees that Duan and Li Shen recommended were not given passing results, while among those passing the examinations were Zheng Lang, the brother of the examination bureau (門下省, "Menxia Sheng") official Zheng Tan; Pei Zhuan () the son of the military governor Pei Du (also a former chancellor); Li Zongmin's son-in-law Su Chao (); and Yang Rushi's brother Yang Yinshi (). This thus brought a popular uproar, and Duan submitted a report accusing Yang Rushi and Qian of being unfair. When Emperor Muzong requested opinions from the imperial scholars, Li Deyu, Yuan, and Li Shen all agreed with Duan's opinion. Emperor Muzong thus ordered Li Zongmin's colleague Wang Qi () to conduct a re-examination, while demoting Qian, Li Zongmin, and Yang Rushi to be prefectural prefects and deposing 10 of the examinees selected by Qian and Yang Rushi.