repatched for jira-1377 for branch 4.1