close the stream