Added indexing when adding new document