changed error logging to be consistent with regular logging