fix bug for directories that have the .js name