defining the callbacks workflow