Fix to use proper variable name and create working predicates