case exit checking