The King of Chu flew into a rage. "How dare you! You even use such vicious words to curse my country and mean to arouse resentment(忿恨) among the people!" Zhuang Xin explained, "I dare not curse the State of Chu. But I really have a premonition(预告) that Chu is facing great danger." Seeing that the king is especially fond of those corrupt officials and trust them in everything, the minister thought Chu is bound to extinct. So he asked the king to let him leave Chu. He wanted to go to the State of Zhao and stay there for a while.
The king gave him the leave.
Five months later, the King of Qin sent his troops to invade Chu and occupied a large tract of its territory. The King of Chu himself went into exile. Now, the king remembered Zhuang Xin's words. He sent his men to fetch him. When the king saw Zhuang Xin again, he asked him, "What can I do now?"
Zhuang Xin replied, "It's not too late if you mend the sheepfold(羊圈) when you find a sheep is missing." He then made some good suggestions to rehabilitate the state and recover the lost land. The king was very much pleased.
The idiom "Mend the fold after a sheep is lost" has developed from Zhuang Xin's answer to the king.
We still use this metaphor to advise someone that even when he has made a mistake and suffered losses, he can still remedy it by drawing lessons from the mistake.