Each worker has it's own global, and there are more than one workers. When you're incrementing it in one place the other workers aren't getting that, so they still have the old number. This article may help more- http://docs.screeps.com/contributed/caching-overview.html