fix bad var in state updates