Fixing logic bug for mergeUp