cannot close stream, flush instead