see comments on StateId