check mainWindow is not null in @After