add #reset and #foreach