Fix query string in old function