Added querystring to query func