added sys.exit(1) if fail