implemented a working inheritance from eventemmiter