add debugging to streams