Cherrypick recovery fix until it gets merged