fixed deletion of foreign key
fixed deletion of foreign key