testing automatic reference deletion