change sys.exit to retrun