applying patch from DS-1410, merging with changes from DS-1503/PR-196