Update Main.py

better, more graceful program exit