Edited onUpgrade