replaced Buffer* to Buffer::SPtr