Prevent possible crash: Check whether process wants to exit before continuing processing