In 1839, acting Captain James Abbott of the Bengal Artillery undertook a mission to the Khanate of Khiva in an attempt to negotiate the release of Russian slaves that would deny the Russians a pretext for invading Khiva. If war had already broken out, Abbot was instructed to attempt to negotiate a settlement. The attempted Russian assault on Khiva may have been in response to Britain's "forward policy" on Afghanistan, however it failed to reach Khiva due to the severe winter conditions. Of the 5,000 men who had left Orenburg, only 4,000 returned. Abbott was hampered by a lack of understanding of Khivan language and culture, and the attempt to release Russian slaves was unsuccessful. He did agree with the Khivan ruler, Allah Quli Khan, to establishing a British agent to Khiva and to mediate between Khiva and Russia. Abbott set off from Khiva in 1840 towards Russia to commence negotiations, which he did on his own initiative and it was not authorised by his superiors. His caravan was attacked by Khazakhs and he was wounded in the hand and taken hostage, however he and his party were released because they feared retribution. He reached Saint Petersburg but the attempt at mediation failed. His bravery was recognized through promotion to full Captain. In the same year, Lieutenant Richmond Shakespear of the Bengal Artillery was successful in negotiating the release of 416 Russian captives, whom he escorted into Russia. He was knighted for this undertaking.