detect current document version