Fixed incorrect ordering of chat messages