adding example for before and after hooks