updated window assignment to global variable