tweaked the callback handling