fix for IE8

If parentNode is documentFragment it will never crash in IE8.