Exit early from the while loop as well