set state via id