adds ~index to  multiple classes