Fix error in IE8 because Document type is undefined