add logic to deal with null bytestrings