read-cache: fix wrong 'the_index' usage