Yes, and the part you added is missing the fact of saving some informations.
The default capx does check on start of execution of the game if a key exists.
If it doesn't, it creates a default value and creates the key,
Otherwise, it sets a global variable value to the value contained in the key.
Then you added a modification of the global variable, but at no point did you save the value of this variable to the key.
So the modification is lost each time you execute the game and only loads the "default value" which is contained in the key.