fix relation bugs