added `isDir` and `isFile` methods