housekeeping for merge