Debug hook