added on_message_received callback