Added support for documents