Added functionality to handle member function class in shared_ptr