Updated main.js file