Close the stream after read