are you sure the last one is also the most recent?

I'd calculate and store the latest timestamp when we store it with registerMessage instead :) if the new message timestamp is bigger than the stored one, then store it, it's the new latest :)