Add onMerge hook