Player dying after the morph dies

so I’ve made a GUI that lets player change into a character if they clicked it but the problem is; when the player dies or reset while on the morphed and tried to morph back again they die and also teleports to the place where they die

local remoteEvent = game.ReplicatedStorage.MorphRemoteEvents.MorphToRig
local NewCharacter = game.ReplicatedStorage.Rigs.Rig:Clone()
NewCharacter.Name = “Rig”

remoteEvent.OnServerEvent:Connect(function(player)
print(player.Name)
– OldCharacter
local oldCharacter = player.Character
local oldCharacterPosition = oldCharacter.HumanoidRootPart.CFrame

-- NewCharacter
player.Character = NewCharacter
NewCharacter.Parent = workspace
NewCharacter.HumanoidRootPart.CFrame = oldCharacterPosition
oldCharacter:Destroy()

end)

if not player.character then return end