fixed printDocumentTitle method