updated main.js script file