added twig and fixed event dispatcher