corrected bug for identifying untag cases

fixed bug where case is not detected if tag to remove is a child node