fix header reading logic.