modify query params and add debug statements