fixed automatic page generation