better handling WebSocket