changed the delegate to a weak reference