Why is the `$?.exited?` needed?