bugfix: make sure it returns and properly disposes current window just after restarting