fix patching order