Added documentsAdded functionality.