finished writing the database