fix duplicated foreign key