Since the condition was not templated, it wasn't working. Only variables in local scope were used, which made this not very practical