make sure we close the log file