Fixed query string check