fix addToSet
basic @index support