JS syntax errors fix