possible fix for manyToMany relationships using indexes