first attempt to port add_callback()