bugfix for bytestream