Handle the correctness of the variables in the foreach statement from lemon