(20)The contractual arrangement with the selected third party to whom the safekeeping functions are delegated should contain an early termination clause, as it is necessary for the depositary to be in position to terminate that contractual relationship in cases where the law or case law of a third country changes in such a way that the protection of the UCITS' assets is no longer ensured. In those cases the depositary has to notify the management company or the investment company thereof. The management company or the investment company has to notify its competent authorities and take all necessary measures which are in the best interest of the UCITS and its investors. The notification of the competent authorities about the increased custody and insolvency risk to UCITS' assets in a third country should not discharge the depositary or the management company or the investment company from their duties and obligations laid down in Directive 2009/65/EC.