Updated Code in Main.js