As described by Western visitors before 1453, such as the Córdoban nobleman Pero Tafur[93] and the Florentine geographer Cristoforo Buondelmonti,[94] the church was in a dilapidated state, with several of its doors fallen from their hinges; Mehmed II ordered a renovation of the building. Mehmed attended the first Friday prayer in the mosque on 1 June 1453.[95] Aya Sofya became the first imperial mosque of Istanbul.[96] To the corresponding waqf were endowed most of the existing houses in the city and the area of the future Topkapı Palace.[5] From 1478, 2,360 shops, 1,300 houses, 4 caravanserais, 30 boza shops, and 23 shops of sheep heads and trotters gave their income to the foundation.[97] Through the imperial charters of 1520 (AH 926) and 1547 (AH 954) shops and parts of the Grand Bazaar and other markets were added to the foundation.[17]