fixing foreign key