resolved string to byte array issue for writeBytes output + minor