Update to use unsafeWindow part 1 of 2