copying doc to index