merge callbacks correctly