fix addref calls