added get_state()