add flag for enabling/disabling pagination