Added onNotification function