BUGFIX global state variables must be explicitely updated