bugfixes and filtering the documents in the document dialogue