The original mosque was square planned and was covered with one large dome in addition to a half dome on the direction of the mihrab while the other area was covered with small domes . The earthquake of 1766 caused a great damaged to the building that it could not be repaired anymore . The mosque was then rebuilt in the period of Mostafa III (1757-74) with a different plan than the original one from 1767 to 1771 . The architect of the new building was Mehmet Tahir Aga who also designed the plan of Laleli mosque .