reset before each branch, not just before the first