fix some js syntax errors