added a gc() event and changed the default functionality to use weak reference.