fix to getPairsRanging