fixed bug in sorting messages by ordinal