How to send notification when an agent stops