Correcting of JS syntax error