delete doc.version if it exists
error handling
Merge pull request #2 from maxogden/version

delete doc.version if it exists