Fix document adding