new method updateState()