Added a try/except loop to __main__ to capture user exit