added checks around cdn delete