fixed foreign key refs