modified getErrorName func