Correctly store log when exiting progress dialog