Add idempotency to listener done and end