Roblox Stop Animation help

this is a script in server script service and :Play() works but Stop() doesnt, how do i fix this?

local toggled = false

game.Players.PlayerAdded:Connect(function(plr)
	plr.Chatted:Connect(function(message)

		if message == "/whip" then
			local char = plr.Character
			local hum = char.Humanoid
			local whip = script.whipEmote
			local animtrackPlay = hum:LoadAnimation(whip)
			
			if toggled == false then
				toggled = true
				print("began emoting")
				animtrackPlay:Play()
			else
				print("toggled emoting off")
				toggled = false
				animtrackPlay:Stop()
			end
		end
	end)
end)

Try putting the whip and animtrackplay variables outside of the events and if statements