added relationship logic