Add callbacks to the functions