improve upgrade from old versions
fix upgrade