fix for chrome unsafeWindow