updated the source code to validate with the JSLint