fix bugs in top and bottom page.