finish the header and footer