updated diff to directly apply patch_apply