use name instead of index