change ended state to final