stream closed properly