fix directories not being recognized as existing