Set the IK control on the head

good day.
I have a problem with setting the EndEffector on the head.
normally I wouldn’t have a problem, but the animated heads are to blame for everything.

IKRezistence.EndEffector = char.Head

This line of the script sets the EndEffector to the head.
Everything works as it should. However, if any player sets an animated head on their avatar, the EndEffector will be nil.

Does anyone know how to fix this bug? I know that if I set it manually in the studio, then it will work.