Added action hooks for before and after redirect