add debugging function