Fix bug in JS syntax error