correct the mess in upmerge logic