fixing errors detected by jshint