Log file now only saved when log window closed