change the if statement to an until block