hasError method