Fixed a condition of do-while.