added prePatch method