use sys.exit to get return value