tidy up mistakes in javascript / handlebars