fixed issue with calling functions insid an if conditional using the templating syntax