 In 1030, Mahmud, because of his bad relations with his heir Mas'ud, changed his opinion, and appointed Mohammad as his heir, who was much less experienced in government and military affairs than Mas'ud.Mahmud shortly died, and was succeeded by Mohammad, who then appointed Abu Sahl Hamduwi as his "vizier".At his accession, much power of the state was under the former "vizier" Hasanak Mikali and military officer Ali ibn Il-Arslan, who greatly administered the state.