fixing up header logic