fixed some errors by jshint