fixed bug in evaluator

successfully tested $foreach