mongo db minor change on update method and some jslint fixes