human
Solve the following python programming problem given the following code:
def is_valid_join_expression(self, expr) : 
    def joining_tables(table) : 
        for fk in self.db.all_joins (table) : 
            (yield (fk.table if (table != fk.table) else fk.reftable)) 
if ('**' not in expr) : 
        return False 
tables = expr.split ('**') 
    valid = True 
    while (len (tables) > 1) : 
        tail = tables.pop () 
        jointables = joining_tables (valid) 
        valid = bool ((set (jointables) & set (tables))) 
        if (not valid) : 
            break 
return valid 

    
    

    Fix the buggy line: jointables = joining_tables (valid)
assistant
#Here is Python code to fix the buggy line: jointables = joining_tables (valid)
.

jointables = joining_tables (tail)