removed memory leak, agent may now copy to agent pointed to