Added support for document metadata