How can I check if theres more than 1 frame with the same name?

I have a UI (yes, it’s a leaderboard) and every frame is the players username ingame but a bug came out which was that if someone joined there was a chance for their frame to be duplicated (basically 2 frames with their headshot,name,displayname on it)

How would I check this and stop it?

maybe something like

Function CheckForDuplicates(player)
local elements = 0

for x, textlabel in ipairs(ElementParent:GetChildren()) do
if textlabel.Name == player.Name and elements == 0 then
elements = elements + 1 -- basically store only one element, restart the loop without removing it, remove any other element found after
else textlabel:Destroy()
       end
    end
end

Locate the part of the script which creates those frames and wrap it in a statement like:

if not Frames:FindFirstChild(player.Name) then 
--create the frame
else 
--maybe update it by destroying the old one?
end