public function init()
    {
        // init the audit module
        Yii::app()->getModule('audit');

        // catch fatal errors
        if ($this->catchFatalErrors) {
            register_shutdown_function(array($this, 'handleFatalError'));
            //Yii::app()->onEndRequest[] = array($this, 'handleFatalError');
            if (substr(php_sapi_name(), 0, 3) != 'cli') {
                ob_start(array($this, 'handleFatalBuffer'));
            }
        }

        // track the request
        if ($this->trackAllRequests)
            $this->getAuditRequest();

        // call parent
        parent::init();
    }