while loop not working.