That is a nasty error! that's why i always use

while (snakeEyes);
Or

while (!snakeEyes);
That way i will never make that mistake. But you should try to find out what is wrong with your code,...