fix for issue #3458 on master branch
refactor as reviews from @mesutcelik for issue #3458
Merge pull request #3459 from serkan-ozal/fix/master/issue-3458

fix for issue #3458 on master branch