making resources idempotent