beforeMerge final