bug fixing according to jslint - started