Added closure on main.js