Should fix #1261

Comment From: harawata

Thank you for the review, @kezhenxu94 ! The change is merged and you can test the new implementation using the latest 3.5.6 snapshot. Please let me know if there is any problem.

Cc : @zhangweidavid @liuyueve