add flush call after merge