Corrected js to conform to jshint