fix #2287 in 2.0.x branch