changed to std::shared_ptr