fix foreign key constraint