fixed issue with sub() method
Merge pull request #2002 from lwyszomi/case-86719

fixed issue with sub() method