cleaning up stream handling when they fail