Avoiding NoResult exception