Added logic to write the new NAICS assignments back into the database