fixing logical operators for Twig