fixed bug with relationships