Around this time, the official Liu Yan headed a project to reopen Bian River (), a canal that connected the Yellow River and the Huai River, which had been crucial for shipping food supplies from the Yangtze River-Huai River region to Chang'an and Luoyang prior to the Anshi Rebellion but which had become silted during the wars. After the project was completed, Chang'an again had adequate food supplies, allowing the region to begin to recover. Pugu, meanwhile, had allied with Huige and Tibet, and in late 764 and then again in 765 allied with them to attack the Chang'an region. After Pugu died in 765, however, the threat subsided, and his army resubmitted to Emperor Daizong. However, by this point, Emperor was facing, in addition to the four major Yan generals, two more military governors who were "de facto" independent, Li Zhengji and Liang Chongyi.