master: fixing data race issue with indexes