not working using shared_ptr to change the object's members