fixed the errors which were observed by jslint