fixed foreign key conundrum