fixed bug with edit-doc
querying permanent views