implemented some validation on exceptions being thrown