update callback handling code