 As per the 4th volume of Uyun'l-Akhbar (comp.842/1438), Imam Mohammad resided in Medina to spread Ismailism and to search for a place of hiding for himself.The Abbasid caliph of the time, Harun al-Rashid, was investigating Imam Muhammad's whereabouts and had forces deployed throughout Medina in search for him.