fixed condition when throws exception