Fix to deal with the case when exceptions are thrown