improved  upgrade file