call flush before closing