Changed way of exception generation