Fixed removeAllListeners method