fix #38101 and #36651