fix js errors for jshint