After gaining the support of Terkan Khatun, he built a tomb for Shaykh Abu Ishaq-i Shirazi, and a school in Baghdad (known as Madrasa-i Tajiya) in order to gain some support from the masses. He slowly and carefully started his opposition to Nizam al-Mulk. Helped by some other courtiers, his goal was to depose Nizam al-Mulk, though Nizam al-Mulk didn't take them seriously, and the Sultan himself wasn't able to depose Nizam al-Mulk.