Added code for before and after calls.