using eventEmitter to transfer messages to different modules and adding socket events