add correct copy and free