Listen for `exit` inside `end`