Fix while sentence bug