Error protection from when a node is detached from the DOM