add clause for deleted resource in history