added set_instance_state, state_equals_state, poll_for_state