Fix failure condition bug