Fix bug - reset variable in callback so that the next time the callback is invoked, the variable doesn't have its old value.