corrected after JSLint