bug fix for reading headers.