add custom function on merge event