fix bug twig function