suggestion for iron golem AI

When i was playing and set up a base in the 1.14 pre-release 2 in a village and the iron golem that spawned if i didn't go to bed as soon as it became night it would started murder hoboing away from the village so i was thinking if minecraft could tweak their ai so that they met up with the villager at the bell so they didn't wonder of into the distance leaving the village defenseless it would fix the problem.