XP Give 20 Instead Of 10

When Player Has A Gamepass it Gives The Player 2x XP It Works But It Gives 20 Instead Of 10

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local remoteEvent = ReplicatedStorage.Events.MadeToEnd
local sendtime = ReplicatedStorage.Events.SendTime
script.Parent.Touched:Connect(function(hit)
	local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
	local Playing = plr.Playing
	if hit.Parent:FindFirstChild("Humanoid") and Playing.Value == true then
		Playing.Value = false
		remoteEvent:FireClient(plr)
	local function gettime(player, data)
			print(player.Name .. " got " .. data)
			
			if data < 40 then
				plr.leaderstats.xp.Value = plr.leaderstats.xp.Value + (50 - data)
				
				if player.Gamepasses.DoubleXP.Value == true then
					
					plr.leaderstats.xp.Value = plr.leaderstats.xp.Value + 10
					
					print(player.Name .. " got " .. "Gamepass")					
				
			else
					plr.leaderstats.xp.Value = plr.leaderstats.xp.Value + 5
					
				end
				
			end
		
end

sendtime.OnServerEvent:Connect(gettime)
	end
	
	hit.Parent:MoveTo(Vector3.new(-99.431, 23, -163.79))

end)

Could the ontouch function be firing mutiple times ( if so make a Debounce - When and Why)

also I see u have an exp addition equation in and outside the if statement is that intentional? could that be the problem?