replaced the assignment of the a raw pointer with an assignment of a shared_pointer