put header and footer in right place