Made app terminate on window close.