make index updates atomic