removeAllListeners prevents memory leak bug