Change do-while to while