prevent error throwing when sending data to closed websocket