Add callbacks before and after running a frame