make sure log is flushed