fixed a bug where the window will never show up