Fixing JavaScript/Twig syntax error