public function deleteInstance($selfedit = "false", $instanceName=null, $returnurl = null) {
        $this->selfedit = $selfedit;

        if ($selfedit == "true") {
            $this->moufManager = MoufManager::getMoufManager();
        } else {
            $this->moufManager = MoufManager::getMoufManagerHiddenInstance();
        }

        $this->moufManager->removeComponent($instanceName);
        $this->moufManager->rewriteMouf();

        if ($returnurl) {
            header("Location:".$returnurl);
        } else {
            header("Location: .?selfedit=".$selfedit);
        }
    }