Under what conditions can a contract be terminated?