Added use of buf.toString()