finish header and footer