fixed ordering of mesages when inserted