Fixed bug with handling total failure case