update headers and foots