public function getCurrentStep()
    {
        $startStepClass = $this->config()->get('start_step');

        // Check if there was a start step defined on the subclass of MultiForm
        if (!isset($startStepClass)) {
            user_error(
                'MultiForm::init(): Please define a $start_step on ' . static::class,
                E_USER_ERROR
            );
        }

        // Determine whether we use the current step, or create one if it doesn't exist
        $currentStep = null;
        $StepID = $this->controller->getRequest()->getVar('StepID');
        if (isset($StepID)) {
            $currentStep = DataObject::get_one(
                MultiFormStep::class,
                [
                    'SessionID' => $this->session->ID,
                    'ID' => $StepID
                ]
            );
        } elseif ($this->session->CurrentStepID) {
            $currentStep = $this->session->CurrentStep();
        }

        // Always fall back to creating a new step (in case the session or request data is invalid)
        if (!$currentStep || !$currentStep->ID) {
            $currentStep = Injector::inst()->create($startStepClass);
            $currentStep->SessionID = $this->session->ID;
            $currentStep->write();
            $this->session->CurrentStepID = $currentStep->ID;
            $this->session->write();
            $this->session->flushCache();
        }

        if ($currentStep) {
            $currentStep->setForm($this);
        }

        return $currentStep;
    }