added removeAllListeners in cleanup to fix bug