change scoped_ptr to std::unique_ptr