updating validation code