Corrected pagination on query with filters