attempt to fix bug in adding a foreign key immediately after adding one