added check isNull document.body, because if keep unchecked then throws exception (document is hide)