fixing callback handling