fixed syntax errors in js