Changed do/while conditions