changed sys.exit to raise Exception in ic