fixed validation so that it doesn't add the error text more than once