call destroy handler before deleting document