fix js syntax errors