Add method to lock the document.