fix syntax errors in js