Chapter 3 - event emitter - pub/sub

added a fix to work in Mac OS