Why do you need the while statement in your loop? Try removing the while statement, and let the loop function make your code repeat. while(1) freezes your loop, and causes the contents of while(1) to repeat forever. Perhaps this will not allow the serial data to change.