fix legacy indexing