updated main.js file