Added a listener for client's changes to the document.