changes to fix weak ref clang warning