Added the validation code