Pathfinding script fix?

Hello, Iv made a pathfinding script which searches for parts in a folder on the workspace. It all works find however upon finding the part to walk towards its always walks via another selected part in the group and i cannot understand why. As when the part is choosen it is renamed so it cannot be picked again/by another NPC

Example of my script

Activewalk = false

While true do
If game.workspace.Waypoints:FindFirstChild(“Cat”) and activewalk = false then
Activewalk = true
Local walkpoint = game.workspace.Waypoints.Cat
Walkpoint.Name = CatChoosen

Then its the pathfinding script

Followed with a else option for selecting another part called walkpoints when there is no cats available to walk towards.

Howeve for some reason once the NPC finds a cat for example it walks towards it but going via the other cats instead of directly too the selected one.

Hope this makes sense, the cat is just used as an example lol