debug hook