fix foreign key constriaint