issue-2 use shared_ptr