Ibn Sina subsequently settled at Rey, in the vicinity of modern Tehran, the home town of Rhazes; where Majd Addaula, a son of the last Buwayhid emir, was nominal ruler under the regency of his mother (Seyyedeh Khatun). What office did Ibn Sina lose in Hamadan