Fix websocket connection close issue.