add auto patching