fixed upgrade crash