fix regression in 4dd5b105

Ref: #2523, #2832