correcting saving error messages to log