remove explicit outputstream flush as close flushes streams before closing