update the index after each change too