Changes to messages logic