fix javascript syntax errors