fixed not reacting to window close button and esc key