fixes #2614 for maintenance-3.x