Change query params middleware