Correct query on total failures