public function closeAll()
    {
        $open = array();
        foreach ($this->states as $key => $state) {
            if ($state->isOpen()) {
                $state->close();
                $open[] = $key;
            }
        }
        return $open;
    }