use a copy for shared ptr