please also add a `_before` event, which is before the foreach