fix #7172 and #7174