extensive updates to debug hooks