fix failure clearing code