modified a setupBuffer method.
update demo.