Fixed issue removing a listener while enumerating