Fix in the query for document types