fixing cherrypicked d530d836