Added correct transforming of messages before sending them