Fixed websocket crash bug