use sys.exit and not just exit