add Exception into codes