fixed bad websocket implementation