fix bugs related to old dir struct