modefied index.js