fix bug of while.