Liu Bang and his followers took refuge on Mount Mangdang and lived as outlaws in an abandoned stronghold. Liu had maintained secret contact with some of his old friends such as Xiao He and Cao Shen who still lived in Pei County. In 209 BCE, two men named Chen Sheng and Wu Guang began the Dazexiang Uprising to overthrow the Qin dynasty. The magistrate of Pei County considered joining the rebellion as well and acting on the advice of both Xiao He and Cao Shen, he sent Fan Kuai (a relative of Liu Bang) to invite Liu and his followers back to Pei County to support him. However, he later decided against it and ended up denying Liu Bang entry into his lands. He also worried that Liu's friends Xiao He and Cao Shen might decide to open the gates for Liu now that he had been denied entry, so he set a plan in motion to kill them but Xiao and Cao managed to escape before it was put into action and eventually joined up with Liu and his entourage. While in Liu's company, Xiao came up with a plan to gain entry into the county and managed to convince Liu to take his advice. Liu Bang ordered his men to write letters, wrap them around their arrows and fire the arrows over the border and into the neighboring county from which they had been barred. In the letters they urged the local townsfolk to help him. The peasants responded to this call for aid by killing the magistrate and welcoming Liu back into Pei County. Liu Bang decided to style himself the Duke of Pei () after this and became known to others by this title.