I think that most call to handler.close() will also call handler.flush(). We can just call handler.close() and don't worry about flushing.