added sys.exit()