fix bug in setuppage's generate headers and footers function