using sys.exit() instead of return