I agree that it would be better to call it from outside the Tutorial. From app.js, for example.
Sending a signal to it when the app is about to exit, either by finishing the tutorial or by skipping it.