this should fix UnicodeEncodeError with non-ascii queries