Added debug output to callback