bug-fix: patch err delete on foreign key