public function setFlash($value, $index = null)
    {
        if ( ! $this->isOpened()) {
            $this->start();
        }
        if (!empty($index)) {
            $this->flashes[$index] = $value;
        } else {
            $this->flashes[] = $value;
        }
        return $this;
    }