 After he was released he traveled first to Badakhshan and then to Samarkand, where he was treated as a guest of the local Timurid princes.He was eventually recalled by Yunus Khan, who was then on his deathbed.Departing Samarkand, he went to Tashkent and treated the khan during his illness.