add state switch in enterframe, would be optimus lately