fix insertStateData bug