Fix import missing issue; add condition to trigger upgrade