fix for patches in shared memory mode