updated pagination logic
Pulled From V2
Pulled From V2