memory leak in cli mode (must remove listener on command response)