removed global window var in tests