replaces the patch to appropriate place