Fixed error with relationships