Add callbacks to functions