inherits eventemitter func