It was rebuilt by the Emperor Valens in the fourth century , restored several times by both the Byzantines and Ottomans , and remained in use up to as recently as the 19th century .
Emperor Valens destroyed most of the building so that no one used it again .