added sys.exit() to main