add debugging code