new fix to header&footer
fixed corrupted header after refactoring