fix relationship indexing