fix for document terms distributions