Abbasid caliph, mamoon, tried to establish good relations with alawis for political reasons when he crowned imam ali bin musa al-ridha as a crown prince. He pretended coalition with them as they were rightful people for caliphate. He replaced the abbasid motto by the alawi motto in 193 A.H. and gave orders to build imam hussain shrine and to allow the alawis and their followers to go about freely for visiting imam shrine, so shias felt free and safe.
During mamoon reign the holy shrine was rebuilt and the high building continued to 232 A.H. when mutawakil ruled aggressively against shia. Become he hated ahlal-bait lprogeny of prophet mohemmed; he treated their followers cruelly.