fixing the bug that firing the off() call in the emit() call will mess up the emit call index