Change setError method to addError