fix code as per jshint