fixed inheritance and event emitter memleaks