add (cherry-pick) commit from master branch

change according to commit 8181ff89b3e917d58cf98d3cfc48b020b9592914