added validation to relationship