Fix ending state