Fixed Code for onMessage/onCompose and onPresence