use shared_ptr to wrap COW string avoid data racing