Added an event that is triggered when the generation ends