close stream - memory leak