reworked the way currentState and rootState deal with null.