fixed detection of merge situation