Set up while loop validation

Set up while loop validation