Bugfix: window contents disappear when close the window