make annotation and re-indexing atomic