add @document variable to document view