Add debugging to action hooks