use unique_ptr; fix build