changed window to global