Change the message already before it is written

Otherwise the one who sends the message will not see the edited
message.