CRM-13892 : fix upgrade function
Merge pull request #2290 from yashodha/CRM-13892

CRM-13892 : fix upgrade function