Corrected code after jslint.