Check if the window is defined