Added code to window method close
Changed how the app closes, the previous method did not work