public function doingAction(string $action = '', bool $flag = null): bool
    {
        if ($action && isset($flag)) {
            $this->doing_actions[$action] = $flag;
        }
        if ($action) {
            return $this->doing_actions[$action] ?? false;
        } else {
            return !empty($this->doing_actions);
        }
    }