convert bytesref into strings in format function