This assignment should be moved outside of this do ... while loop. It should be in the above var declaration.