add a callback

cc @sh1mmer @dfellis @kumikoda