Fixed an issue with the quit event.

The id was not updated every time.