event emitter bugfix