deal with buffer and string