fixed a problem during re-patching