-validation code