repair header and footer