applying patch from DS-1410, merging with changes from DS-1503/PR-196
Merge pull request #405 from hardyoyo/DS-1410

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