switch name to index