add document remove and fix document permissions