Logic of retrieving of content of the messages updated.
Updates after testing of the whole flow.