added handling for querying strings with non standard characters