Fixed websocket handling workflow