updated index.js file