Improved callback handling