Add receivedEvent function