javascripts syntax fixes