why is xpath 1-indexed, ugh. fixing off by one error