Modified to support clearing failures