[relationships] fixed cache invalidation [closes #27]