[DF-651] manually merged diff from old pull request