add import for weakref