public method to add errors to a field