replace all occurances of window with unsafeWindow

this fixes issues with GM 2.2
release v2.7.6