fixed number of clauses bug