index was not thread safe