check for error message key before error key