CRM-13892 : fix upgrade function

CRM-13892 : fix upgrade function