Fixing issue with pagination on second page