fixed array out of bounds error in getUniqueList