corrected pagination