convert to using environment variables in query string