 After Wagang Fort's collapse, he served for the warlord Wang Shichong (王世充).When his old time friends including Qin Shubao, Cheng Yaojin (程咬金) and Xu Shiji (徐世勣, or Xu Maogong 徐茂公) were all leaving for Li Shimin, he stayed with Wang Shichong, because Li Shimin's father Li Yuan mistakenly killed his brother Shan Xiongzhong (单雄忠, or Shan Dao 单道) in early years.Later, he married Wang Shichong's daughter.