Replaced callback with event

- I replaced the callback method with an new event.
- Fixed the terminate reason bug again

Regards