Stand Summon Bug

Hey all, I have been making a JoJo game but I recently found a bug in the stand summon, if I rapidly hit Q(Stand Summon KeyCode) it’ll spawn another stand on top of the one that’s already there, when it really should be de-equipping it, any ideas on how I can fix this? – Here’s the code to it by the way

UIS.InputBegan:Connect(function(key, gpe)
	if gpe then
		return
	elseif key.KeyCode == Enum.KeyCode.Q then
		if summonDebounce == false and isActive == false and script:GetAttribute("activated") == false then
			summonDebounce = true
			isActive = true
			script:SetAttribute("activated", true)
			
			Summon:FireServer(isActive)
			wait(3)
			summonDebounce = false
			script:SetAttribute("activated", false)
		elseif summonDebounce == false and isActive == true and script:GetAttribute("activated") == false then
			summonDebounce = true
			isActive = false
			script:SetAttribute("activated", true)

			Summon:FireServer(isActive)
			wait(3)
			summonDebounce = false
			script:SetAttribute("activated", false)
		end

---defined varibles are 
local UIS = game:GetService("UserInputService")
local summonDebounce = false
local isActive = false