middleware for filtering params