Merge pull request #19 from Wuisch/document

document edit method
right check for document