changed so it only updates sent messages with the id