public function register($name = null, $entries = [], $attributes = [])
    {
        if (empty($name)) {
            $name = self::DEFAULT_MENU_NAME;
        }

        // check if menu's name does not exist
        $exists = false;

        foreach ($this->menus as $menu) {
            if ($menu->getName() == $name) {
                $exists = true;
            }
        }

        if (!$exists) {
            $this->menus->push(new MenuContainer($name, $entries, $attributes));
        } else {
            throw new MenuExistsException($name);
        }
    }