add debugging callback