Fixed a bug caused by the directory refactor