how to check if websocket connection is closed