How to prevent flashing in chat?

I have made custom colours and font for the players when they chat, but the game seems to display the normal chat settings for 0.1 seconds and then display the correct settings. This causes a message to flash when it is received. How would I ensure that the chat only displays messages when the settings are returned?

--When message is sent in chat
TCS.OnIncomingMessage = function(msg)
	
	--Avoid duplicate messages
	if msg.Status == Enum.TextChatMessageStatus.Success then
		
		--Define msgProperties
		local msgProperties = CWC:DeriveNewMessageProperties()
		
		--Define locatedPlr
		local locatedPlr = game.Players:GetPlayerByUserId(msg.TextSource.UserId)
		
		--otherstats
		local otherstats = locatedPlr:FindFirstChild("otherstats")
		local chatColour = otherstats:FindFirstChild("chatColour")
		local chatFont = otherstats:FindFirstChild("chatFont")
		
		--Edit msgProperties
		local R = chatColour.Value.R * 255
		local G = chatColour.Value.G * 255
		local B = chatColour.Value.B * 255
		msgProperties.PrefixText = string.format('<font color="rgb(%d, %d, %d)">[%s]: </font>', R, G, B, locatedPlr.Name)

		msgProperties.FontFace = Font.fromName(chatFont.Value,Enum.FontWeight.Regular,Enum.FontStyle.Normal)
		
		--Set msgProperties
		msg.ChatWindowMessageProperties = msgProperties
		
		--Return
		return msgProperties
		
	end
	
end

Here is a video of the issue:

Try removing this if statement: if msg.Status == Enum.TextChatMessageStatus.Success then

When messages are first displayed they temporarily are in a sending state and OnIncomingMessage is first invoked, it’s then invoked again when the message has been filtered.