how about not destroy the window before entering message loop