get messages in the right order