Add 'var' in getUniqueSelectionPalette function

'var' keyword was missing for variable 'i' in getUniqueSelectionPalette function.