fixed bug when validating errors