fix for Document.getElementsByTagName() freeze