using eventEmitter for uncaught errors