Foreign key fix