Updated next URL handling to not duplicate querystring args