main.js modified