Windows machines returns false for stats.isDirectory()