fixed merge #3185 for master-2.5