a minor modification on buffer.go