Fixed an issue where removing event handler in executing event handler may cause other handlers not to be executed