added jshint checking and fix all jshint warnings