Modify main.js to align with handlebars tpl