Set up ending state checker