convert strings to buffers if necessary