apply CB-6685 to 3.5.x branch. This closes #33