Fixed jslint error & small bug

* fixed jslint erorr
* fixed value checking of if statement