add several changes for upgrade