fixes #2112
Merge pull request #2316 from enesakar/backport-issue-2112

fixes #2112 ( backport of #2136 )