fix #8050

(cherry picked from commit 364cd0cbca232db058c25b7094d35dcd4d38e26e)