fix readBytes