Added control on type of exception