adjusting behavior of abortstream, closestream, and stopstream