store all messages temporary in a var
in a case of an error, the messages can be written into the log file