made the application exit nicely