fix js to pass jslint