fixed bug of upgrade