public function exists($name, $pos = null)
    {
        if (!$pos) {
            foreach ($this->getAssetTypes() as $type) {
                $assets = $this->getAssetsByPos($type);

                if (isset($assets[$name])) {
                    return true;
                }
            }
        } else {
            $assets = $this->getAssetsByPos($pos);

            return isset($assets[$name]);
        }

        return false;
    }