fixed handling upgrading errors