Fix getting attribute from relationship