patch to avoid crash when messages without type are sent