better callback handling