Corrected buf.toString
Corrected buf.toString