fix foreach_element macro