add some debugging hooks