type comparator for messages