Fix while statement