Validation when parsing