handle websocket client errors to prevent crash