public function usePlugin($plugin_name, $config = array())
    {
        if (!isset($this->plugins[$plugin_name])) {
            $plugin_name = str_replace(".", "\\", $plugin_name);
            //allow plugin name to use . sign
            $plugin_class_name = $plugin_name."\Main";
            $this->plugins[$plugin_name] = new $plugin_class_name();
            $this->plugins[$plugin_name]->setAppInstance($this);
            $this->plugins[$plugin_name]->load($config);
        }
        return $this->plugins[$plugin_name];
    }