don't we need to close stream after writing