Fixing with pagination logic