modify page's generate method.