patching routine