applied patch for CRM-12705
Merge pull request #874 from kurund/CRM-12705

applied patch for CRM-12705