I am trying to change the state of an array when an event happens in the browser, specifically when the websocket is triggered, the problem is that my array keeps the origin