fix ordering of messages when loaded from cache