Modified logic to implement query string parameters.