fix bug of merging