fixing websocket bug