Fixed infinite recursion issue with  function, required unit array for both variables to be the same object.