public function initEventsManager()
    {
        $taskListener = new TaskListener();

        //extracts default events manager
        $eventsManager = $this->di->getShared('eventsManager');
        //attaches new event console:beforeTaskHandle and console:afterTaskHandle
        $eventsManager->attach(
            'console:beforeHandleTask', $taskListener->beforeHandleTask($this->arguments)
        );
        $eventsManager->attach(
            'console:afterHandleTask', $taskListener->afterHandleTask()
        );
        $this->application->setEventsManager($eventsManager);
    }