when websocket closes, reset the listeners to {}