Using global variable isWindow