changed log to more effectively log error messages