Please could you format your code correctly:
Indentation is very important in while loops, and it may be the problem in your code. Danny