fix issues with older IE in compatibility with HTMLDocument