Solved uncaught exception when trying to send on a closed websocket