Handle cases when stored value is foreign key and deleted