[backport] fix #1257