fix foreign keys