How can I keep this from happening?

I have an inverse kinematics system, but how would I reset the arm’s position when the red part gets deleted?

As you can see, in the video, after I delete the red part the arm does not go back to its original cframe. Is there any way I can fix this?

Here is a link to the inverse kinematics system:

Note that the inverse kinematics system was not made by me!

I am sorry but in the video I could not see when you deleted the red part.
Can I see the script being used please.