Fix upgrade error