In 234, Zhuge Liang became critically ill during a stalemate at the Battle of Wuzhang Plains against Wei forces. During this time, when Li Fu asked Zhuge Liang who could succeed him as the head of the Shu government, Zhuge Liang replied that Jiang Wan could succeed him and that Fei Yi could succeed Jiang Wan. After Li Fu left, Zhuge Liang secretly instructed Yang Yi, Fei Yi and Jiang Wei to lead the army back to Shu after his death, with Wei Yan and Jiang Wei in charge of the rearguard. If Wei Yan refused to follow orders, they were to retreat without him. After Zhuge Liang died, Yang Yi ordered news of his death to be kept secret, and then instructed Fei Yi to meet Wei Yan and assess his intentions.