Error with documents fixed