add index.js to file path if module path refer to a folder