modified idempotency check