bug fix: now check if ReceivedMessage event is null before calling