Make patch class idempotent