type should be one of the indeces