implemented deleting the document