reverted pagination function default to a range of 2 and not 0