bug fix: reset index if handler count is changed when emitting (resolves issue where .once() handler caused next event handler to be skipped)