check app exit