Added hasError method
Fixed validator logic