was checking doe a file when a dir