Fixed bug for 404 errors from dirs