update the hook to update the index.