Use correct primary key for relationship