Global variables: loosing the value

If that's all the code you are going to show us, how are we supposed to help? Anything we say would just be a guess. Post the whole sketch.