add max fail support