more idempotent operations and better error recovery