Improves thread safety of the in memory index