fixed bug returning wrong bytecount