Checks if relationship index exists before creating.

I just wanted to do a pull request for this to see if you think this works.

This is a fix for my comment on #26