make set_state() and friends return the new sm_state