making it work for unicode and string both