fix model indexing