added get_final_state