weak_ref fix