bug fix for when text nodes are removed directly from the dom