why getValueIndex - 1?