bugs in foreign keys