 He was not a good commander or governor, however, and his campaign north suffered constant defections and defeats.By fall 618, he was in a desperate situation, and deciding to become emperor before final defeat, he poisoned Yang Hao and declared a new state of Xu with himself as emperor.In 619, Yuwen Huaji was captured and executed by one of the rebel leaders, Dou Jiande the Prince of Xia.