Main.js modified