Fixes the crash with stateID.