Integrated fix of read chunk into main code