Added user validation code