fix compile error from cherry-picked commit dee5b3fc2785