Change to.isFile to to.isDirectory
Changes to be compatible with MediaFileManager