add a debug hook to get the stack