in case the stream is closed