Fixed onUpgrade method