logwarnning as soon as it enters the while loop