setup validation with a while loop

setup validation with a while loop