Fix discrepency in indexing in UI and model