Oops, remember to check if window actually exists before checking if display is closed