update to free the object reference

update to free the object reference so that cg can free it