fix a bug in merge