fixed while statement