Fix bug DNN-3691: apply fix from Jira.