debug hooks