fixed buf with strlen when sending characters