Adding better callback handling