foreign key deletion fixed