add a function in the body to be run in the footer