changed getParagraph to call getDocument method inside