add exceptions throwing and handling