cherrypicked cf0da4f755b09237572237cab048279603312981