super ugly if condition added to support x,y,z components in PathPosition