update for new foreign code handling