add debugging
more hooks