Added upgrade logic