added before + after triggers on controller

I've added the before and after triggers to on controller.